package com.atguigu.gulimall.auth.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author Yanglinfengkk
 * 自定义SpringMvc viewcontroller  将请求和页面映射过来
 */
@Configuration
public class GuliMallWebConfig implements WebMvcConfigurer {

    /**
     * 视图映射
     * 实现无业务逻辑跳转页面
     * @param registry
     */
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        //addViewController()添加视图控制器 mapping
        /**
         *  @GetMapping(value = "/login.html")
         *     public String loginPage(){
         *         return "login";
         *     }
         */
        //登录跳转/注册成功跳转登录页
        //registry.addViewController("/login.html").setViewName("login");
        //注册跳转
        registry.addViewController("/reg.html").setViewName("reg");
        //注册成功跳转登录页

    }
}
